package com.league.zjxn.jetpack.repository

import com.league.zjxn.app.SPSConstance
import com.league.zjxn.base.BaseManager
import com.league.zjxn.entity.*
import rxhttp.RxHttp
import rxhttp.await

open class LeagueRepository : BaseManager() {

    suspend fun leagueEnterprise(
        industry_id: String? = null,
        title: String? = null,page: String, limit: String
    ): LeagueMemberResponse {

        val http = RxHttp.get("/api/enterprise/enterprise")
            .addHeader("token", SPSConstance.token?:"")
            .add("page", page)
            .add("limit", limit)
        if (!industry_id.isNullOrEmpty()){
            http.add("industry_id",industry_id)
        }
        if (!title.isNullOrEmpty()){
            http.add("title",title)
        }
        return http.await()
    }

    suspend fun userIndustryList(): IndustryListResponse =
        RxHttp.get("/api/getIndustryList")
            .addHeader("token", SPSConstance.token ?: "")
            .await()


}